﻿#ifndef WATER_TYPEDEF_H_
#define WATER_TYPEDEF_H_
#include <string>

typedef enum {
    E_WATER_MODE_NONE = 0,       //无
	E_WATER_MODE_ICE,					//冰块
	E_WATER_MODE_ICE_WATER,     //冰水
    E_WATER_MODE_COMMON_WATER,  //常温水
    E_WATER_MODE_RED_TEA,      		 //红茶
    E_WATER_MODE_BUBBLE_MILK,  	 //泡奶
	E_WATER_MODE_HONEY_WATER,	//蜂蜜水
    E_WATER_MODE_GREEN_TEA,     	//绿茶
    E_WATER_MODE_FLAVOUR_TEA,   //花茶
    E_WATER_MODE_PU_ERH_TEA,    //普洱茶
    E_WATER_MODE_SELF,     		//自定义

//	E_WATER_MODE_LEMON_WATER,	//柠檬水
//    E_WATER_MODE_COFFEE_TEA,    //咖啡

} EWaterMode;

//工作状态
typedef enum {
	E_WATER_STATE_IDLE = 0,		    //空闲(待机)
	E_WATER_STATE_ICE_WATER,		//出冰水
	E_WATER_STATE_COMMON_WATER, 	//出常温水
	E_WATER_STATE_HOT_WATER,		//热水
} EWaterState;

typedef enum {
    E_CARTRIDGE_TYPE_PPC = 0,
    E_CARTRIDGE_TYPE_RO,
    E_CARTRIDGE_TYPE_C2,
    E_CARTRIDGE_TYPE_ALL
} E_CARTRIDGE_TYPE;  //滤芯类型

//定时任务id定义
typedef enum {
	E_TIMER_EVENT_ALL_BRASH = 0,	                //整机冲洗
    E_TIMER_EVENT_ICE_ADD_WATER,	                //冰水箱补水

    E_TIMER_EVENT_MAKE_WATER_TIMEOUT,	            //制水超时（外供净水）
    E_TIMER_EVENT_FILTER_BRASH,                     			//滤芯冲洗
    E_TIMER_EVENT_DRAIN_WATER_LONG,                 //长按排水
    E_TIMER_EVENT_DRAIN_WATER_SHORT,                //短按排水
    E_TIMER_EVENT_ZERO_STATE_WATER_A,               //零陈水a
    E_TIMER_EVENT_ZERO_STATE_WATER_B,               //零陈水b

    E_TIMER_EVENT_WATER_CHECK_PRESS_TEST,           //水检保压测试
	E_TIMER_EVENT_WATER_LED_OFF,                    //LED灯自动关闭
	E_TIMER_EVENT_WATER_PREVENT_DRY_BURNING,		//防干烧
	E_TIMER_EVENT_WATER_HOT_WATER_DELAY,			//点击停止出水键后，下发温度指令出95℃热水出2秒后再下发指令

	E_TIMER_EVENT_STOP_REFRIGERATION	,		//停止制冷负载

	E_TIMER_EVENT_ICE_ADD_BLOCK,					//制冰箱补水
	E_TIMER_EVENT_MAKE_ICEPUMP,					//制冰泵控制
	E_TIMER_EVENT_ROD_MOTOR,			//推杆电机控制
	E_TIMER_EVENT_ICE_STICK,					//冰块防沾

	E_TIMER_EVENT_MAKE_ALLICE,			//制大中小冰
	E_TIMER_EVENT_OUT_ICE,					//出冰
	E_TIMER_EVENT_FORCE_OUT,				//强制脱冰
	E_TIMER_EVENT_STOP_ICE,					//停冰
	E_TIMER_EVENT_INTER_CLEAN,					//内部清洗
} ETimerEventId;

//任务优先级（0-n，0最高，n最低; 高优先级打断低优先级, 相同优先级可以并行, 有高优先级任务时，低先级任务不能执行）
typedef enum {
    E_TASK_PRIORITY_0 = 0,
	E_TASK_PRIORITY_1,
	E_TASK_PRIORITY_2,
} ETaskPriority;

typedef enum {
    E_TASK_ID_ALL_BRASH = 0,						 //整机冲洗
    E_TASK_ID_ICE_ADD_WATER,						 //冰水箱补水

    E_TASK_ID_MAKE_WATER_TIMEOUT,					 //制水超时
    E_TASK_ID_FILTER_BRASH,							 //滤芯冲洗
    E_TASK_ID_DRAIN_WATER,							 //排水
    E_TASK_ID_ZERO_STATE_WATER,						 //零陈水

    E_TASK_ID_WATER_CHECK_PRESS_TEST,				 //水检保压测试
    E_TASK_ID_WATER_OPERATE,						 //出水停水操作

	E_TASK_ID_STOP_REFRIGERATION,		//停止制冷操作
	E_TASK_ID_MAKE_ICE,							//制冰
	E_TASK_ID_MOTOR_ICE,							//出冰电机
} ETaskId;

typedef struct {
	int min;      //最小值
	int max;      //最大值
	int def;      //默认值
	int step;     //步长
} SOptionRange;

typedef struct {
    const char* name;
    const char* icon;
} SModeInfo;

typedef struct {
    EWaterMode mode;   //模式
    SOptionRange water_output;   //出水量范围
    SOptionRange water_temp;     //温度范围
} SWaterOption;


typedef struct {
    EWaterMode mode;   //模式
    int water_output;   //出水量
    int water_temp;     //水温
} SWaterParam;

typedef struct {
    std::string name;   //模式名称
    std::string icon;   //模式图标
    EWaterMode collected_mode; 	//收藏模式id(0表示还没有收藏)
    SWaterOption option;   //模式选项
} SModeInfoEx;

#endif // WATER_TYPEDEF_H_
